//
//  GlobalViewControllers.m
//  Pregnant
//
//  Created by xiangming on 14-4-22.
//  Copyright (c) 2014年 elitework. All rights reserved.
//

#import "GlobalViewControllers.h"

@interface GlobalViewControllers()

@property(strong,nonatomic) RightViewController *p_menuViewController;
@end

static GlobalViewControllers *sharedGlobal= nil;

@implementation GlobalViewControllers

+ (instancetype)sharedGlobal{
    static dispatch_once_t onceToken;
    dispatch_once(&onceToken, ^{
        if (!sharedGlobal) {
            sharedGlobal = [[GlobalViewControllers alloc] init];
        }

    });

        return sharedGlobal;
}

-(RightViewController *)menuViewController{
    if (!self.p_menuViewController) {
        UIStoryboard *board=[UIStoryboard storyboardWithName:@"Main" bundle:nil];
        self.p_menuViewController =  (RightViewController *)[board instantiateViewControllerWithIdentifier:@"RightViewController"];
    }
    return self.p_menuViewController;
}

-(BOOL)hasMenuShowedBefore{
    return self.p_menuViewController!=nil;
}

-(void)dealloc{
    self.p_menuViewController=nil;
}

@end
